<?php
/* @var $this DefaultController */
$this->layout = '//layouts/admin/default';

$this->breadcrumbs=array(
	$this->module->id,
);
$this->pageTitle = '首页';


$uptime = $sysInfo['uptime'];
$stime = date("Y-n-j H:i:s");
$df = round(@disk_free_space(".")/(1024*1024*1024),3);
$dt = round(@disk_total_space(".")/(1024*1024*1024),3);

$load = $sysInfo['loadAvg'];	//系统负载


//判断内存如果小于1GB，就显示M，否则显示GB单位
if($sysInfo['memTotal']<1024)
{
	$memTotal = $sysInfo['memTotal']." MB";
	$mt = $sysInfo['memTotal']." MB";
	$mu = $sysInfo['memUsed']." MB";
	$mf = $sysInfo['memFree']." MB";
	$mc = $sysInfo['memCached']." MB";	//cache化内存
	$mb = $sysInfo['memBuffers']." MB";	//缓冲
	$st = $sysInfo['swapTotal']." MB";
	$su = $sysInfo['swapUsed']." MB";
	$sf = $sysInfo['swapFree']." MB";
	$swapPercent = $sysInfo['swapPercent'];
	$memRealUsed = $sysInfo['memRealUsed']." MB"; //真实内存使用
	$memRealFree = $sysInfo['memRealFree']." MB"; //真实内存空闲
	$memRealPercent = $sysInfo['memRealPercent']; //真实内存使用比率
	$memPercent = $sysInfo['memPercent']; //内存总使用率
	$memCachedPercent = $sysInfo['memCachedPercent']; //cache内存使用率
}
else
{
	$memTotal = round($sysInfo['memTotal']/1024,3)." GB";
	$mt = round($sysInfo['memTotal']/1024,3)." GB";
	$mu = round($sysInfo['memUsed']/1024,3)." GB";
	$mf = round($sysInfo['memFree']/1024,3)." GB";
	$mc = round($sysInfo['memCached']/1024,3)." GB";
	$mb = round($sysInfo['memBuffers']/1024,3)." GB";
	$st = round($sysInfo['swapTotal']/1024,3)." GB";
	$su = round($sysInfo['swapUsed']/1024,3)." GB";
	$sf = round($sysInfo['swapFree']/1024,3)." GB";
	$swapPercent = $sysInfo['swapPercent'];
	$memRealUsed = round($sysInfo['memRealUsed']/1024,3)." GB"; //真实内存使用
	$memRealFree = round($sysInfo['memRealFree']/1024,3)." GB"; //真实内存空闲
	$memRealPercent = $sysInfo['memRealPercent']; //真实内存使用比率
	$memPercent = $sysInfo['memPercent']; //内存总使用率
	$memCachedPercent = $sysInfo['memCachedPercent']; //cache内存使用率
}

//网卡流量
$strs = file_get_contents("/proc/net/dev"); 
$strs = explode("\n",$strs);
for ($i = 2; $i < count($strs); $i++ ){
	preg_match_all( "/([^\s]+):[\s]{0,}(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)/", $strs[$i], $info );
/*	$NetInput[$i] = formatsize($info[2][0]);
	$NetOut[$i]  = formatsize($info[10][0]);
 */ 
	if(isset($info[2][0])){	
		$tmo = round($info[2][0]/1024/1024, 5); 
		$tmo2 = round($tmo / 1024, 5);
		$NetInput[$i] = $tmo2;
	}
	if(isset($info[10][0])){	
		$tmp = round($info[10][0]/1024/1024, 5); 
		$tmp2 = round($tmp / 1024, 5);
		$NetOut[$i] = $tmp2;
	}
}

if ($act == "rt"){
	$arr=array(
		'freeSpace'=>"$df",
		'TotalMemory'=>"$mt",
		'UsedMemory'=>"$mu",
		'FreeMemory'=>"$mf",
		'CachedMemory'=>"$mc",
		'Buffers'=>"$mb",
		'TotalSwap'=>"$st",
		'swapUsed'=>"$su",
		'swapFree'=>"$sf",
		'loadAvg'=>"$load",
		'uptime'=>"$uptime",
		#'freetime'=>"$freetime",
		#'bjtime'=>"$bjtime",
		'stime'=>"$stime",
		'memRealPercent'=>"$memRealPercent",
		'memRealUsed'=>"$memRealUsed",
		'memRealFree'=>"$memRealFree",
		'memPercent'=>"$memPercent%",
		'memCachedPercent'=>"$memCachedPercent",
		'barmemCachedPercent'=>"$memCachedPercent%",
		'swapPercent'=>"$swapPercent",
		'barmemRealPercent'=>"$memRealPercent%",
		'barswapPercent'=>"$swapPercent%",
		'NetOut2'=>"$NetOut[2]",
		'NetOut3'=>"$NetOut[3]",
		#'NetOut4'=>"$NetOut[4]",
		#'NetOut5'=>"$NetOut[5]",
		#'NetOut6'=>"$NetOut[6]",
		#'NetOut7'=>"$NetOut[7]",
		#'NetOut8'=>"$NetOut[8]",
		#'NetOut9'=>"$NetOut[9]",
		#'NetOut10'=>"$NetOut[10]",
		'NetInput2'=>"$NetInput[2]",
		'NetInput3'=>"$NetInput[3]",
		#'NetInput4'=>"$NetInput[4]",
		#'NetInput5'=>"$NetInput[5]",
		#'NetInput6'=>"$NetInput[6]",
		#'NetInput7'=>"$NetInput[7]",
		#'NetInput8'=>"$NetInput[8]",
		#'NetInput9'=>"$NetInput[9]",
		#'NetInput10'=>"$NetInput[10]"
	);
	$jarr=json_encode($arr); 
	echo $_GET['callback'],'(',$jarr,')';
	exit;
}
?>
<style>
* {font-family: Tahoma, "Microsoft Yahei", Arial; }
h1 {font-size: 26px; font-weight: normal; padding: 0; margin: 0; color: #444444;}
h1 small {font-size: 11px; font-family: Tahoma; font-weight: bold; }
a{text-decoration:none;}
a.black{color: #000000; text-decoration:none;}
b{color: #999999;}
table{clear:both;padding: 0; margin: 0 0 10px;border-collapse:collapse; border-spacing: 0;}
th{padding: 3px 6px; font-weight:bold;background:#3066a6;color:#FFFFFF;border:1px solid #3066a6; text-align:left;}
.th_1{padding: 3px 6px; font-weight:bold;background:#666699;color:#FFFFFF;border:1px solid #3066a6; text-align:left;}
.th_2{padding: 3px 6px; font-weight:bold;background:#417291;color:#FFFFFF;border:1px solid #3066a6; text-align:left;}
.th_3{padding: 3px 6px; font-weight:bold;background:#067201;color:#FFFFFF;border:1px solid #3066a6; text-align:left;}
.th_4{padding: 3px 6px; font-weight:bold;background:#666666;color:#FFFFFF;border:1px solid #CCCCCC; text-align:left;}
.th_5{padding: 3px 6px; font-weight:bold;background:#333333;color:#FFFFFF;border:1px solid #CCCCCC; text-align:left;}
.th_6{padding: 3px 6px; font-weight:bold;background:#FF6600;color:#FFFFFF;border:1px solid #FF6600; text-align:left;}
tr{padding: 0; background:#F7F7F7;}
td{padding: 3px 6px; border:1px solid #CCCCCC;}
input{padding: 2px; background: #FFFFFF; border-top:1px solid #666666; border-left:1px solid #666666; border-right:1px solid #CCCCCC; border-bottom:1px solid #CCCCCC; font-size:12px}
input.btn{font-weight: bold; height: 20px; line-height: 20px; padding: 0 6px; color:#666666; background: #f2f2f2; border:1px solid #999;font-size:12px}
.bar {border:1px solid #999999; background:#FFFFFF; height:5px; font-size:2px; width:89%; margin:2px 0 5px 0;padding:1px;overflow: hidden;}
.bar_1 {border:1px dotted #999999; background:#FFFFFF; height:5px; font-size:2px; width:89%; margin:2px 0 5px 0;padding:1px;overflow: hidden;}
.barli_red{background:#ff6600; height:5px; margin:0px; padding:0;}
.barli_blue{background:#0099FF; height:5px; margin:0px; padding:0;}
.barli_green{background:#36b52a; height:5px; margin:0px; padding:0;}
.barli_1{background:#999999; height:5px; margin:0px; padding:0;}
.barli{background:#36b52a; height:5px; margin:0px; padding:0;}
#page {width: 920px; padding: 0 20px; margin: 0 auto; text-align: left;}
#header{position: relative; padding: 10px;}
#footer {padding: 15px 0; text-align: center; font-size: 11px; font-family: Tahoma, Verdana;}
#lnmplink {position: absolute; top: 20px; left: 115px; text-align: right; font-weight: bold; color: #06C;}
#lnmplink a {color: #0000FF; text-decoration: underline;}
.w_small{font-family: Courier New;}
.w_number{color: #f800fe;}
.sudu {padding: 0; background:#5dafd1; }
.suduk { margin:0px; padding:0;}
.resYes{}
.resNo{color: #FF0000;}
.word{word-break:break-all;}
</style>
<div class="container container-admin">
    <div class='row'>
        <div class="span3">
            <?php $this->beginWidget('AdminLeftNavWidget');$this->endWidget();?>
        </div>
        <div class="span9">
            <div class='page-header' style='width:106%'>
                <h2>
                    <span class='fui-calendar-solid'></span>
                    网站性能检测
                </h2>
            </div>
            <div class="tabbable"> <!-- Only required for left/right tabs -->
                <ul class="nav nav-tabs">
                    <li class="active"><a href="#tab1" data-toggle="tab">服务器参数</a></li>
                    <li><a href="#tab2" data-toggle="tab">服务器实时数据</a></li>
					<li><a href="#tab3" data-toggle="tab">网络使用状况</a></li>
					<li><a href="#tab4" data-toggle="tab">PHP已编译模块检测</a></li>
					<li><a href="#tab5" data-toggle="tab">PHP相关参数</a></li>
					<li><a href="#tab6" data-toggle="tab">组件支持</a></li>
					<li><a href="#tab7" data-toggle="tab">第三方组件</a></li>
					<li><a href="#tab8" data-toggle="tab">数据库支持</a></li>
					<li><a href="#tab9" data-toggle="tab">功能检测</a></li>
                </ul>
                <div class="tab-content tab-content-content">
                    <div class="tab-pane active" id="tab1">
						<!--服务器相关参数-->
						<table width="100%" cellpadding="3" cellspacing="0" class='table'>
							<tr><th colspan="4">服务器参数</th></tr>
							<tr>
								<td>服务器域名/IP地址</td>
								<td colspan="3">
<?php echo $_SERVER['SERVER_NAME'];?>(
<?php 
if('/'==DIRECTORY_SEPARATOR){
	echo $_SERVER['SERVER_ADDR'];
}else{
	echo @gethostbyname($_SERVER['SERVER_NAME']);
} ?>
							)
								</td>
							</tr>
							<tr>
								<td>服务器标识</td>
								<td colspan="3">
<?php 
	if(isset($sysInfo['win_n']) && $sysInfo['win_n'] != ''){
		echo $sysInfo['win_n'];
	}else{
		echo @php_uname();
	};
?>
								</td>
							</tr>
							<tr>
								<td width="">服务器操作系统</td>
								<td width=""  colspan="3">
<?php 
$os = explode(" ", php_uname()); 
echo $os[0];
?> 
&nbsp;内核版本：
<?php 
if('/'==DIRECTORY_SEPARATOR){
	echo $os[2];
}else{
	echo $os[1];
} 
?>
								</td>
							</tr>
                            <tr>
                                <td width="">服务器解译引擎</td>
                                <td width="" colspan="3"><?php echo $_SERVER['SERVER_SOFTWARE'];?></td>
                            </tr>
							<tr>
								<td>服务器语言</td>
								<td colspan="3"><?php echo getenv("HTTP_ACCEPT_LANGUAGE");?></td>
							</tr>
                            <tr>
                                <td>服务器端口</td>
                                <td colspan="3"><?php echo $_SERVER['SERVER_PORT'];?></td>
                            </tr>
							<tr>
								<td>服务器主机名</td>
								<td colspan="3"><?php if('/'==DIRECTORY_SEPARATOR ){echo $os[1];}else{echo $os[2];} ?></td>
							</tr>
                            <tr>
                                <td>绝对路径</td>
                                <td colspan="3">
                                    <?php echo $_SERVER['DOCUMENT_ROOT']?str_replace('\\','/',$_SERVER['DOCUMENT_ROOT']):str_replace('\\','/',dirname(__FILE__));?>
                                </td>
                            </tr>
							<tr>
								<td>管理员邮箱</td>
								<td colspan="3"><?php echo isset($_SERVER['SERVER_ADMIN']) ? $_SERVER['SERVER_ADMIN'] : 'zhangdapeng89@126.com';?></td>
							</tr>
                            <tr>
                                <td>探针路径</td>
                                <td colspan="3"><?php echo str_replace('\\','/',__FILE__)?str_replace('\\','/',__FILE__):$_SERVER['SCRIPT_FILENAME'];?></td>
                            </tr>
							<tr>
								<td colspan=4>
								<?php $run_time = sprintf('%0.4f', ProbeWidget::microtimeFloat() - $timeStart);?>
								Processed in <?php echo $run_time?> seconds. <?php echo ProbeWidget::memoryUsage();?> memory usage.
								</td>
							</tr>
						</table>
 
                    </div>
                    
                    <div class="tab-pane" id="tab2">
						<table width="100%" cellpadding="3" cellspacing="0" align="center" class='table'>
							<tr><th colspan="6">服务器实时数据</th></tr>
							<tr>
								<td width="13%" >服务器当前时间</td>
								<td width="37%" ><span id="stime"><?php echo $stime;?></span></td>
								<td width="13%" >服务器已运行时间</td>
								<td width="37%" colspan="3">
									<span id="uptime"><?php echo $uptime;?></span>
								</td>
							</tr>
							<tr>
								<td>总空间</td>
								<td><?php echo $dt;?>&nbsp;GB</td>
								<td>
									<a href="#" title="显示的是网站所在的目录的可用空间，非服务器上所有磁盘之可用空间！">
										可用空间
									</a>
								</td>
								<td colspan="3">
									<font color='#CC0000'>
										<span id="freeSpace"><?php echo $df;?></span>
									</font>&nbsp;GB
								</td>
							</tr>
							<tr>
								<td width="13%">CPU型号 [<?php echo $sysInfo['cpu']['num'];?>核]</td>
								<td width="87%" colspan="5"><?php echo $sysInfo['cpu']['model'];?></td>
							</tr>
							<tr>
								<td>内存使用状况<br \><br \>	
									<a href="http://www.vpser.net/other/linux-vps-ram.html" target="_blank">
										<font color=red>内存参数解读</font>
									</a>
								</td>
								<td colspan="5">
								<?php
								$tmp = array(
									'memTotal', 'memUsed', 'memFree', 'memPercent',
									'memCached', 'memRealPercent',
									'swapTotal', 'swapUsed', 'swapFree', 'swapPercent'
								);
								foreach ($tmp AS $v) {
									$sysInfo[$v] = $sysInfo[$v] ? $sysInfo[$v] : 0;
								}
								?>
								物理内存：共
								<font color='#CC0000'><?php echo $memTotal;?> </font>
								, 已用
								<font color='#CC0000'><span id="UsedMemory"><?php echo $mu;?></span></font>
								, 空闲
								<font color='#CC0000'><span id="FreeMemory"><?php echo $mf;?></span></font>
								, 使用率
								<span id="memPercent"><?php echo $memPercent;?></span>
								<div class="bar">
									<div id="barmemPercent" class="barli_green" style="width:<?php echo $memPercent?>%">&nbsp;</div>
								</div>
								<?php if($sysInfo['memCached']>0):	//判断如果cache为0，不显示 ?>
								Cache化内存为 <span id="CachedMemory"><?php echo $mc;?></span>
								, 使用率 
								<span id="memCachedPercent"><?php echo $memCachedPercent;?></span>
								%	| Buffers缓冲为  <span id="Buffers"><?php echo $mb;?></span>
								<div class="bar"><div id="barmemCachedPercent" class="barli_blue" style="width:<?php echo $memCachedPercent?>%">&nbsp;</div></div>
								真实内存使用
								<span id="memRealUsed"><?php echo $memRealUsed;?></span>
								, 真实内存空闲
								<span id="memRealFree"><?php echo $memRealFree;?></span>
								, 使用率
								<span id="memRealPercent"><?php echo $memRealPercent;?></span>
								%
								<div class="bar_1"><div id="barmemRealPercent" class="barli_1" style="width:<?php echo $memRealPercent?>%">&nbsp;</div></div>
								<?php endif;?> 
								<?php if($sysInfo['swapTotal']>0):	//判断如果SWAP区为0，不显示?>	
								SWAP区：共
								<?php echo $st;?>
								, 已使用
								<span id="swapUsed"><?php echo $su;?></span>
								, 空闲
								<span id="swapFree"><?php echo $sf;?></span>
								, 使用率
								<span id="swapPercent"><?php echo $swapPercent;?></span>
								%
								<div class="bar"><div id="barswapPercent" class="barli_red" style="width:<?php echo $swapPercent?>%">&nbsp;</div> </div>
								<?php endif;?>		  
							  </td>
							</tr>
							<tr>
								<td>系统平均负载</td>
								<td colspan="5" class="w_number"><span id="loadAvg"><?php echo $load;?></span></td>
							</tr>
						</table>	
					</div>
                    <div class="tab-pane" id="tab3">
						<?php if (false !== ($strs = file_get_contents("/proc/net/dev"))) : ?>
						<?php $strs = explode("\n",$strs);?>
						<table width="100%" cellpadding="3" cellspacing="0" align="center" class='table'>
							<tr><th colspan="3">网络使用状况</th></tr>
							<?php for ($i = 2; $i < count($strs); $i++ ) : ?>
							<?php preg_match_all( "/([^\s]+):[\s]{0,}(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)/", $strs[$i], $info );?>
							<?php if(isset($info[1][0])):?> 
							<tr>
								<td width="13%"><?php echo $info[1][0]?> : </td>
								<td width="43%">已接收 : 
									<font color='#CC0000'>
										<span id="NetInput<?php echo $i?>">
											<?php echo $NetInput[$i]?>
										</span>
									</font> GB
								</td>
								<td width="43%">已发送 : 
									<font color='#CC0000'>
										<span id="NetOut<?php echo $i?>">
											<?php echo $NetOut[$i]?>
										</span>
									</font> GB
								</td>
							</tr>
							<?php endif;?>
							<?php endfor; ?>
						</table>
						<?php endif; ?>	
					</div>

					<div class='tab-pane' id='tab4'>
						<table width="100%" cellpadding="3" cellspacing="0" align="center" class='table'>
							<tr>
								<th colspan="4" class="th_1">PHP已编译模块检测</th>
							</tr>
							<tr>
								<td colspan="4">
									<span class="w_small">
									<?php
									$able=get_loaded_extensions();
									foreach ($able as $key=>$value) {
										if ($key!=0 && $key%13==0) {
											echo '<br />';
										}
										echo "$value&nbsp;&nbsp;";
									}
									?>			
									</span>
								</td>
						  </tr>
						</table>

					</div>
					<div class='tab-pane' id='tab5'>
						<table width="100%" cellpadding="3" cellspacing="0" align="center" class='table'>
						  <tr><th colspan="4" class="th_1">PHP相关参数</th></tr>
						  <tr>
							<td width="32%">PHP信息（phpinfo）：</td>
							<td width="18%">
							<?php
							$phpSelf = Yii::app()->createUrl('/admin/default');
							$disFuns=get_cfg_var("disable_functions");
							?>
							<?php echo (false!==eregi("phpinfo",$disFuns))? '<font color="red">×</font>' :"<a href='$phpSelf?act=phpinfo' target='_blank'>PHPINFO</a>";?>
							</td>
							<td width="32%">PHP版本（php_version）：</td>
							<td width="18%"><?php echo PHP_VERSION;?></td>
						  </tr>
						  <tr>
							<td>PHP运行方式：</td>
							<td><?php echo strtoupper(php_sapi_name());?></td>
							<td>脚本占用最大内存（memory_limit）：</td>
							<td><?php echo ProbeWidget::show("memory_limit");?></td>
						  </tr>
						  <tr>
							<td>PHP安全模式（safe_mode）：</td>
							<td><?php echo ProbeWidget::show("safe_mode");?></td>
							<td>POST方法提交最大限制（post_max_size）：</td>
							<td><?php echo ProbeWidget::show("post_max_size");?></td>
						  </tr>
						  <tr>
							<td>上传文件最大限制（upload_max_filesize）：</td>
							<td><?php echo ProbeWidget::show("upload_max_filesize");?></td>
							<td>浮点型数据显示的有效位数（precision）：</td>
							<td><?php echo ProbeWidget::show("precision");?></td>
						  </tr>
						  <tr>
							<td>脚本超时时间（max_execution_time）：</td>
							<td><?php echo ProbeWidget::show("max_execution_time");?>秒</td>
							<td>socket超时时间（default_socket_timeout）：</td>
							<td><?php echo ProbeWidget::show("default_socket_timeout");?>秒</td>
						  </tr>
						  <tr>
							<td>PHP页面根目录（doc_root）：</td>
							<td><?php echo ProbeWidget::show("doc_root");?></td>
							<td>用户根目录（user_dir）：</td>
							<td><?php echo ProbeWidget::show("user_dir");?></td>
						  </tr>
						  <tr>
							<td>dl()函数（enable_dl）：</td>
							<td><?php echo ProbeWidget::show("enable_dl");?></td>
							<td>指定包含文件目录（include_path）：</td>
							<td><?php echo ProbeWidget::show("include_path");?></td>
						  </tr>
						  <tr>
							<td>显示错误信息（display_errors）：</td>
							<td><?php echo ProbeWidget::show("display_errors");?></td>
							<td>自定义全局变量（register_globals）：</td>
							<td><?php echo ProbeWidget::show("register_globals");?></td>
						  </tr>
						  <tr>
							<td>数据反斜杠转义（magic_quotes_gpc）：</td>
							<td><?php echo ProbeWidget::show("magic_quotes_gpc");?></td>
							<td>"&lt;?...?&gt;"短标签（short_open_tag）：</td>
							<td><?php echo ProbeWidget::show("short_open_tag");?></td>
						  </tr>
						  <tr>
							<td>"&lt;% %&gt;"ASP风格标记（asp_tags）：</td>
							<td><?php echo ProbeWidget::show("asp_tags");?></td>
							<td>忽略重复错误信息（ignore_repeated_errors）：</td>
							<td><?php echo ProbeWidget::show("ignore_repeated_errors");?></td>
						  </tr>
						  <tr>
							<td>忽略重复的错误源（ignore_repeated_source）：</td>
							<td><?php echo ProbeWidget::show("ignore_repeated_source");?></td>
							<td>报告内存泄漏（report_memleaks）：</td>
							<td><?php echo ProbeWidget::show("report_memleaks");?></td>
						  </tr>
						  <tr>
							<td>自动字符串转义（magic_quotes_gpc）：</td>
							<td><?php echo ProbeWidget::show("magic_quotes_gpc");?></td>
							<td>外部字符串自动转义（magic_quotes_runtime）：</td>
							<td><?php echo ProbeWidget::show("magic_quotes_runtime");?></td>
						  </tr>
						  <tr>
							<td>打开远程文件（allow_url_fopen）：</td>
							<td><?php echo ProbeWidget::show("allow_url_fopen");?></td>
							<td>声明argv和argc变量（register_argc_argv）：</td>
							<td><?php echo ProbeWidget::show("register_argc_argv");?></td>
						  </tr>
						  <tr>
							<td>Cookie 支持：</td>
							<td><?php echo isset($_COOKIE)?'<font color="green">√</font>' : '<font color="red">×</font>';?></td>
							<td>拼写检查（ASpell Library）：</td>
							<td><?php echo ProbeWidget::isfun("aspell_check_raw");?></td>
						  </tr>
						   <tr>
							<td>高精度数学运算（BCMath）：</td>
							<td><?php echo ProbeWidget::isfun("bcadd");?></td>
							<td>PREL相容语法（PCRE）：</td>
							<td><?php echo ProbeWidget::isfun("preg_match");?></td>
						   <tr>
							<td>PDF文档支持：</td>
							<td><?php echo ProbeWidget::isfun("pdf_close");?></td>
							<td>SNMP网络管理协议：</td>
							<td><?php echo ProbeWidget::isfun("snmpget");?></td>
						  </tr> 
						   <tr>
							<td>VMailMgr邮件处理：</td>
							<td><?php echo ProbeWidget::isfun("vm_adduser");?></td>
							<td>Curl支持：</td>
							<td><?php echo ProbeWidget::isfun("curl_init");?></td>
						  </tr> 
						   <tr>
							<td>SMTP支持：</td>
							<td><?php echo get_cfg_var("SMTP")?'<font color="green">√</font>' : '<font color="red">×</font>';?></td>
							<td>SMTP地址：</td>
							<td><?php echo get_cfg_var("SMTP")?get_cfg_var("SMTP"):'<font color="red">×</font>';?></td>
						  </tr> 
							<tr>
								<td>默认支持函数（enable_functions）：</td>
								<td colspan="3"><a href='<?php echo $phpSelf;?>?act=Function' target='_blank' class='static'>请点这里查看详细！</a></td>		
							</tr>
							<tr>
								<td>被禁用的函数（disable_functions）：</td>
								<td colspan="3" class="word">
								<?php 
								$disFuns=get_cfg_var("disable_functions");
								if(empty($disFuns)){
									echo '<font color=red>×</font>';
								}else{ 
									//echo $disFuns;
									$disFuns_array =  explode(',',$disFuns);
									foreach ($disFuns_array as $key=>$value) {
										if ($key!=0 && $key%5==0) {
											echo '<br />';
										}
										echo "$value&nbsp;&nbsp;";
									}	
								}

								?>
								</td>
							</tr>
						</table>			
					</div>
					<div class='tab-pane' id='tab6'>
						<!--组件信息-->
						<table width="100%" cellpadding="3" cellspacing="0" align="center" class='table'>
						  <tr><th colspan="4" class="th_1">组件支持</th></tr>
						  <tr>
							<td width="32%">FTP支持：</td>
							<td width="18%"><?php echo ProbeWidget::isfun("ftp_login");?></td>
							<td width="32%">XML解析支持：</td>
							<td width="18%"><?php echo ProbeWidget::isfun("xml_set_object");?></td>
						  </tr>
						  <tr>
							<td>Session支持：</td>
							<td><?php echo ProbeWidget::isfun("session_start");?></td>
							<td>Socket支持：</td>
							<td><?php echo ProbeWidget::isfun("socket_accept");?></td>
						  </tr>
						  <tr>
							<td>Calendar支持</td>
							<td><?php echo ProbeWidget::isfun('cal_days_in_month');?>
							</td>
							<td>允许URL打开文件：</td>
							<td><?php echo ProbeWidget::show("allow_url_fopen");?></td>
						  </tr>
						  <tr>
							<td>GD库支持：</td>
							<td>
							<?php
								if(function_exists('gd_info')) {
									$gd_info = @gd_info();
									echo $gd_info["GD Version"];
								}else{echo '<font color="red">×</font>';}
							?></td>
							<td>压缩文件支持(Zlib)：</td>
							<td><?php echo ProbeWidget::isfun("gzclose");?></td>
						  </tr>
						  <tr>
							<td>IMAP电子邮件系统函数库：</td>
							<td><?php echo ProbeWidget::isfun("imap_close");?></td>
							<td>历法运算函数库：</td>
							<td><?php echo ProbeWidget::isfun("JDToGregorian");?></td>
						  </tr>
						  <tr>
							<td>正则表达式函数库：</td>
							<td><?php echo ProbeWidget::isfun("preg_match");?></td>
							<td>WDDX支持：</td>
							<td><?php echo ProbeWidget::isfun("wddx_add_vars");?></td>
						  </tr>
						  <tr>
							<td>Iconv编码转换：</td>
							<td><?php echo ProbeWidget::isfun("iconv");?></td>
							<td>mbstring：</td>
							<td><?php echo ProbeWidget::isfun("mb_eregi");?></td>
						  </tr>
						  <tr>
							<td>高精度数学运算：</td>
							<td><?php echo ProbeWidget::isfun("bcadd");?></td>
							<td>LDAP目录协议：</td>
							<td><?php echo ProbeWidget::isfun("ldap_close");?></td>
						  </tr>
						  <tr>
							<td>MCrypt加密处理：</td>
							<td><?php echo ProbeWidget::isfun("mcrypt_cbc");?></td>
							<td>哈稀计算：</td>
							<td><?php echo ProbeWidget::isfun("mhash_count");?></td>
						  </tr>
						</table>

													
					</div>
					<div class='tab-pane' id='tab7'>
						<!--第三方组件信息-->
						<table width="100%" cellpadding="3" cellspacing="0" align="center"i class='table'>
						  <tr><th colspan="4" class="th_1">第三方组件</th></tr>
						  <tr>
							<td width="32%">Zend版本</td>
							<td width="18%">
<?php 
$zend_version = zend_version();
if(empty($zend_version)){
	echo '<font color=red>×</font>';
}else{
	echo $zend_version;
}
?>
							</td>
							<td width="32%">
							<?php
							$PHP_VERSION = PHP_VERSION;
							$PHP_VERSION = substr($PHP_VERSION,2,1);
							if($PHP_VERSION > 2){
								echo "ZendGuardLoader[启用]";
							}else{
								echo "Zend Optimizer";
							}
							?>
							</td>
							<td width="18%">
<?php 
if($PHP_VERSION > 2){
	echo (get_cfg_var("zend_loader.enable"))?'<font color=green>√</font>':'<font color=red>×</font>';
} else{
	if(function_exists('zend_optimizer_version')){	
		echo zend_optimizer_version();
	}else{	
		echo (get_cfg_var("zend_optimizer.optimization_level")||get_cfg_var("zend_extension_manager.optimizer_ts")||get_cfg_var("zend.ze1_compatibility_mode")||get_cfg_var("zend_extension_ts"))?'<font color=green>√</font>':'<font color=red>×</font>';
	}
}
?>
							</td>
						  </tr>
						  <tr>
							<td>eAccelerator</td>
							<td><?php if((phpversion('eAccelerator'))!=''){echo phpversion('eAccelerator');}else{ echo "<font color=red>×</font>";} ?></td>
							<td>ioncube</td>
							<td>
<?php 
if(extension_loaded('ionCube Loader')){
	$ys = ioncube_loader_iversion();   
	$gm = ".".(int)substr($ys,3,2);   
	echo ionCube_Loader_version().$gm;
}else{
	echo "<font color=red>×</font>";
}
?>
							</td>
						  </tr>
						  <tr>
							<td>XCache</td>
							<td><?php if((phpversion('XCache'))!=''){echo phpversion('XCache');}else{ echo "<font color=red>×</font>";} ?></td>
							<td>APC</td>
							<td><?php if((phpversion('APC'))!=''){echo phpversion('APC');}else{ echo "<font color=red>×</font>";} ?></td>
						  </tr>
						</table>					
					</div>
					<div class='tab-pane' id='tab8'>
						<!--数据库支持-->
						<table width="100%" cellpadding="3" cellspacing="0" align="center" class='table'>
						  <tr><th colspan="4" class="th_2">数据库支持</th></tr>
						  <tr>
							<td width="32%">MySQL 数据库：</td>
							<td width="18%"><?php echo ProbeWidget::isfun("mysql_close");?>
							<?php
							if(function_exists("mysql_get_server_info")) {
								$s = @mysql_get_server_info();
								$s = $s ? '&nbsp; mysql_server 版本：'.$s : '';
								$c = '&nbsp; mysql_client 版本：'.@mysql_get_client_info();
								echo $s;
							}
							?>
							</td>
							<td width="32%">ODBC 数据库：</td>
							<td width="18%"><?php echo ProbeWidget::isfun("odbc_close");?></td>
						  </tr>
						  <tr>
							<td>Oracle 数据库：</td>
							<td><?php echo ProbeWidget::isfun("ora_close");?></td>
							<td>SQL Server 数据库：</td>
							<td><?php echo ProbeWidget::isfun("mssql_close");?></td>
						  </tr>
						  <tr>
							<td>dBASE 数据库：</td>
							<td><?php echo ProbeWidget::isfun("dbase_close");?></td>
							<td>mSQL 数据库：</td>
							<td><?php echo ProbeWidget::isfun("msql_close");?></td>
						  </tr>
						  <tr>
							<td>SQLite 数据库：</td>
							<td>
<?php 
if(extension_loaded('sqlite3')) {
	$sqliteVer = SQLite3::version();
	echo '<font color=green>√</font>　';echo "SQLite3　Ver ";
	echo $sqliteVer['versionString'];
}else {
	echo ProbeWidget::isfun("sqlite_close");
	if(isfun("sqlite_close") == '<font color="green">√</font>') {
		echo "&nbsp; 版本： ".@sqlite_libversion();
	}
}
?>
							</td>
							<td>Hyperwave 数据库：</td>
							<td><?php echo ProbeWidget::isfun("hw_close");?></td>
						  </tr>
						  <tr>
							<td>Postgre SQL 数据库：</td>
							<td><?php echo ProbeWidget::isfun("pg_close"); ?></td>
							<td>Informix 数据库：</td>
							<td><?php echo ProbeWidget::isfun("ifx_close");?></td>
						  </tr>
						  <tr>
							<td>DBA 数据库：</td>
							<td><?php echo ProbeWidget::isfun("dba_close");?></td>
							<td>DBM 数据库：</td>
							<td><?php echo ProbeWidget::isfun("dbmclose");?></td>
						  </tr>
						  <tr>
							<td>FilePro 数据库：</td>
							<td><?php echo ProbeWidget::isfun("filepro_fieldcount");?></td>
							<td>SyBase 数据库：</td>
							<td><?php echo ProbeWidget::isfun("sybase_close");?></td>
						  </tr> 
						</table>					
					</div>
					
					<div class='tab-pane' id='tab9'>
						<form class='form-horizontal' method='post'>
						<!--MySQL数据库连接检测-->
						<table width="100%" cellpadding="3" cellspacing="0" align="center" class='table'>
							<tr><th colspan="3" class="th_2">MySQL数据库连接检测</th></tr>
							<tr>
								<td width="15%">地址</td>
								<td width="60%"><input type="text" name="host" value="localhost" size="10" style='height:21px;width:98%'/></td>
								<td width='25%' rowspan=4><input class="btn" type="submit" name="act" value="MySQL检测" /></td>
							</tr>
							
							<tr>
								<td width="15%">端口</td>
								<td width="60%"><input type="text" name="port" value="3306" size="10" style='height:21px;width:98%'/></td>
							</tr>

							<tr>
								<td width="15%">用户名</td>
								<td width="60%"><input type="text" name="login" size="10" style='height:21px;width:98%'/></td>
							</tr>

							<tr>
								<td width="15%">密码</td>
								<td width="60%"><input type="password" name="password" size="10" style='height:21px;width:98%'/></td>
							</tr>
						</table>
						  <?php
						  if ($postAct == 'MySQL检测') {
							if(function_exists("mysql_close")==1) {
								$link = @mysql_connect($host.":".$port,$login,$password);
								if ($link){
									echo "<script>alert('连接到MySql数据库正常')</script>";
								} else {
									echo "<script>alert('无法连接到MySql数据库！')</script>";
								}
							} else {
								echo "<script>alert('服务器不支持MySQL数据库！')</script>";
							}
						  }
							?>
												
					
						<!--函数检测-->
						<table width="100%" cellpadding="3" cellspacing="0" align="center" class='table'>
							<tr><th colspan="3" class="th_4">函数检测</th></tr>
						  <tr>
							<td width="15%">请输入您要检测的函数：</td>
							<td width="60%">
							  <input type="text" name="funName" size="50" style='height:21px;width:98%'/>
							</td>
							<td width="25%">
							  <input class="btn" type="submit" name="act" align="right" value="函数检测" />
							</td>
						  </tr>
						  <?php
						  if ($postAct == '函数检测') {
							echo "<script>alert('$funRe')</script>";
						  }
						  ?>
						</table>
						
					
						<!--邮件发送检测-->
						<table width="100%" cellpadding="3" cellspacing="0" align="center" class='table'>
						  <tr><th colspan="3" class="th_5">邮件发送检测</th></tr>
						  <tr>
							<td width="15%">请输入您要检测的邮件地址：</td>
							<td width="60%">
								<input type="text" name="mailAdd" size="50" style='height:21px;width:98%'/>
							</td>
							<td width="25%">
								<input class="btn" type="submit" name="act" value="邮件检测" />
							</td>
						  </tr>
						  <?php
						  if ($postAct == '邮件检测') {
							echo "<script>alert('$mailRe')</script>";
						  }
						  ?>
						</table>
						</form>					
					</div>
                </div>
            </div>
        </div>
    </div>
</div>
